#!/usr/bin/env python
#coding=utf-8

import sys
import string
import gzip

if len(sys.argv) == 1:
    print 'please enter your file!\n gzip.py .gz file'
    sys.exit()
else:
    sf = sys.argv[1]
    if not sf.endswith('.gz'):
        print 'Should be .gz file'
    else:
        tf = sf[:5] + sf[10:12] + '/done.txt'
        print 'from' + sf + 'to' + tf
        
        a = gzip.open(sf, 'rb')
        while True:
            b = a.readline()
            if not b: break
            print b
        a.close()
                